<?php

class Application_Model_Member
{
	protected $_member_id;
    protected $_username;
    protected $_password;
    protected $_email;
    protected $_phone;
    protected $_member_type;
    protected $_job;
    protected $_gender;
    protected $_travel;
    protected $_birth;
    protected $_residence;
    protected $_image;
    protected $_description;
    protected $_deal_credit;
    protected $_rating_credit;
    protected $_total_deal;
    protected $_creation_time;
    protected $_code;
    
    //product_browse
    protected $_amount;
    protected $_product_buy_id;
    protected $_title;
    
    //product_browse
    protected  $_event_year;
    protected  $_event_month;
    protected  $_event_day;
    protected  $_event_title;

    public function __construct(array $options = null)
    {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    public function __set($name, $value)
    {
        $method = 'set' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid member property');
        }
        $this->$method($value);
    }

    public function __get($name)
    {
        $method = 'get' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid member property');
        }
        return $this->$method();
    }

    public function setOptions(array $options)
    {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }

    public function setMember_id($id)
    {
        $this->_member_id = (string) $id;
        return $this;
    }

    public function getMember_id()
    {
        return $this->_member_id;
    }
    
    public function setUsername($text)
    {
        $this->_username = (string) $text;
        return $this;
    }

    public function getUsername()
    {
        return $this->_username;
    }
    
	public function setPassword($text)
    {
        $this->_password = (string) $text;
        return $this;
    }

    public function getPassword()
    {
        return $this->_password;
    }
    
    public function setEmail($text)
    {
        $this->_email = (string) $text;
        return $this;
    }

    public function getEmail()
    {
        return $this->_email;
    }
    
	public function setPhone($phone)
    {
        $this->_phone = (int) $phone;
        return $this;
    }

    public function getPhone()
    {
        return $this->_phone;
    }
    
	public function setMember_type($text)
    {
        $this->_member_type = (string) $text;
        return $this;
    }

    public function getMember_type()
    {
        return $this->_member_type;
    }
    
	public function setJob($text)
    {
        $this->_job = (string) $text;
        return $this;
    }

    public function getJob()
    {
        return $this->_job;
    }
    
	public function setGender($text)
    {
        $this->_gender = (string) $text;
        return $this;
    }

    public function getGender()
    {
        return $this->_gender;
    }
    
	public function setTravel($text)
    {
        $this->_travel = (string) $text;
        return $this;
    }

    public function getTravel()
    {
        return $this->_travel;
    }
    
    public function setBirth($text)
    {
        $this->_birth = (string) $text;
        return $this;
    }

    public function getBirth()
    {
        return $this->_birth;
    }
    
	public function setResidence($text)
    {
        $this->_residence = (string) $text;
        return $this;
    }

    public function getResidence()
    {
        return $this->_residence;
    }

    public function setImage($binary)
    {
        $this->_image =  $binary;
        return $this;
    }

    public function getImage()
    {
        return $this->_image;
    }
    
	public function setDescription($text)
    {
        $this->_description = (string) $text;
        return $this;
    }

    public function getDescription()
    {
        return $this->_description;
    }
    
	public function setDeal_credit($credit)
    {
        $this->_deal_credit =  (int)$credit;
        return $this;
    }

    public function getDeal_credit()
    {
        return $this->_deal_credit;
    }
    
	public function setRating_credit($credit)
    {
        $this->_rating_credit =  (int)$credit;
        return $this;
    }

    public function getRating_credit()
    {
        return $this->_rating_credit;
    }
    
	public function setTotal_deal($total)
    {
        $this->_total_deal =  (int)$total;
        return $this;
    }

    public function getTotal_deal()
    {
        return $this->_total_deal;
    }
    
	public function setCreation_time($text)
    {
        $this->_creation_time =  $text;
        return $this;
    }

    public function getCreation_time()
    {
        return $this->_creation_time;
    }
    
	public function setCode($text)
    {
        $this->_code = (string) $text;
        return $this;
    }
    
	public function getCode()
    {
        return $this->_code;
    }
    
	public function setAmount($amount)
    {
        $this->_amount =  (int)$amount;
        return $this;
    }

    public function getAmount()
    {
        return $this->_amount;
    }
    
	public function setProduct_buy_id($id)
    {
        $this->_product_buy_id = (string) $id;
        return $this;
    }

    public function getProduct_buy_id()
    {
        return $this->_product_buy_id;
    }
    
	public function setTitle($text)
    {
        $this->_title = (string) $text;
        return $this;
    }
    
	public function getTitle()
    {
        return $this->_title;
    }
    
	public function setEvent_year($text)
    {
        $this->_event_year = (string) $text;
        return $this;
    }
    
	public function getEvent_year()
    {
        return $this->_event_year;
    }
    
	public function setEvent_month($text)
    {
        $this->_event_month = (string) $text;
        return $this;
    }
    
	public function getEvent_month()
    {
        return $this->_event_month;
    }
    
	public function setEvent_day($text)
    {
        $this->_event_day = (string) $text;
        return $this;
    }
    
	public function getEvent_day()
    {
        return $this->_event_day;
    }
    
	public function setEvent_title($text)
    {
        $this->_event_title = (string) $text;
        return $this;
    }
    
	public function getEvent_title()
    {
        return $this->_event_title;
    }
}

